home *** CD-ROM | disk | FTP | other *** search
- unit Testu1;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, Buttons;
-
- type
- TfrmMain = class(TForm)
- edtfile: TEdit;
- cbxFound: TCheckBox;
- btnSearch: TButton;
- Label1: TLabel;
- btnClose: TBitBtn;
- cbxMyFunction: TCheckBox;
- procedure btnSearchClick(Sender: TObject);
- procedure cbxFoundEnter(Sender: TObject);
- private
- { Private-Deklarationen }
- public
- { Public-Deklarationen }
- end;
-
- var
- frmMain: TfrmMain;
-
- implementation
-
- {$R *.DFM}
-
- Function ExistFile (FileName : String) : Boolean;
- var
- SR : TSearchRec;
- begin
- Result := (FindFirst (FileName, faAnyFile, SR) = 0) and
- (SR.Name = FileName);
- end;
-
- procedure TfrmMain.btnSearchClick(Sender: TObject);
- begin
- cbxFound.Checked := FileExists (edtFile.Text);
- cbxMyFunction.Checked := ExistFile (edtFile.Text);
- edtFile.SetFocus;
- end;
-
- procedure TfrmMain.cbxFoundEnter(Sender: TObject);
- begin
- edtFile.SetFocus;
- end;
-
- end.
-